table.insert(itemActions,
	function(item, action)
		-- MAGIC amulets
		-- see: dir .. "readme.txt" for information regarding these variables
		local priority = 4
		local identify = true
		local dump = true

		if not (item.quality == ItemQuality.Magic and item.baseItem.code == "amu") then
			return false
		elseif action == aPICK and (not item.flags.Identified or isGoodMagicAmulet(item)) then
			return priority
		elseif action == aIDENT then
			return identify
		elseif action == aSELL and item.flags.Identified and not isGoodMagicAmulet(item) then
			return true
		elseif action == aDUMP and item.flags.Identified and not isGoodMagicAmulet(item) then
			return dump
		end

		return false
	end
)

function isGoodMagicAmulet(item)
	-- no easy customs available for this
	-- feel free to change the lower prefix/suffix bounds
	local prefix, suffix, affix =  false, false, false

	for i = 0, item.mods:size() - 1 do
		if item.mods[i].Stat.Type == StatType.ClassSkillsBonus and
				item.mods[i].Value == 2 then -- 2sk->prefix
			prefix = true
		elseif item.mods[i].Stat.Type == StatType.SkillTabBonus and
				item.mods[i].Value == 3 then --  3sktab->prefix
			prefix = true
		elseif item.mods[i].Stat.Type == StatType.MaxMana and
				item.mods[i].Value >= 91 then --  91+mp->prefix
			prefix = true
		elseif item.mods[i].Stat.Type == StatType.FasterCastRate then
			suffix = true -- any fcr->suffix
		elseif (item.mods[i].Stat.Type == StatType.Strength or
				item.mods[i].Stat.Type == StatType.Dexterity or
				item.mods[i].Stat.Type == StatType.Energy) and
				item.mods[i].Value >= 21 then -- 21+str/dex/eng->suffix
			suffix = true
		elseif (item.mods[i].Stat.Type == StatType.MaxLife or
				item.mods[i].Stat.Type == StatType.MaxMana) and
				item.mods[i].Value >= 81 then -- 81+hp or mp->suffix
			suffix = true
		elseif item.mods[i].Stat.Type == StatType.MagicFind and
				item.mods[i].Value >= 40 then -- 40+mf->affix
			affix = true
		end
	end

	return (
		   (prefix and suffix)
		   or affix
		   )
end